package com.ljb.nfcreadandwritedemo.read;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.ljb.nfcreadandwritedemo.BaseNFCActivity;
import com.ljb.nfcreadandwritedemo.R;

/**
 * Created by ljb on 2018/8/1.
 */
public class ReadTextActivity extends BaseNFCActivity {
    private static final String TAG = "ReadTextActivity";
    private TextView tvRead;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_read);
        tvRead = findViewById(R.id.rv_read);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        String nfcId = nfcHelper.readNFC_ID(intent);
        String nfcNdef = nfcHelper.readNFC_NDEF(intent);
        if (nfcId != null && nfcNdef != null) {
            nfcHelper.vibrate(this);
            tvRead.setText("内容为:  \r\n nfcId = " + nfcId + " ;\r\n nfcNdef = " + nfcNdef);
        }
    }

}

























